$(document).ready(function (){
    ajaxObj=new Object;
    ajaxObj.course_id=-1;
    ajaxObj.resources_id=-1;
    ajaxObj.url="";
    $('.courseResourcesBox .courseResourcesDownloadItem').click(function(){
        showDownloadInfo($(this));
    });
});
/**
 * show download information in the modal dialog
 * @author : nonglei
 * @date   : 06/05/2014
 */
function showDownloadInfo(elem)
{
    ajaxObj.course_id = elem.attr("course");
    ajaxObj.resources_id = elem.attr("resources");
    ajaxObj.url = elem.attr('actionUrl')+"/"+ajaxObj.course_id;
    var data = "ajax=1&&course="+ajaxObj.course_id+"&&resources="+ajaxObj.resources_id;
    var success = function(data){
        eval(data);
        $(".courseResourcesBox #downloadTitle").html(data.title);
        $(".courseResourcesBox #downloadContent").html(data.content);
        $(".courseResourcesBox #downloadButton").attr("value",ajaxObj.resources_id);
    };
    var rs = ajaxConstruction(ajaxObj.url,data,"JSON",success);
}

